package wowrl.gui;

import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;
import java.awt.Component;


@SuppressWarnings("serial")
public class CustomListRenderer extends DefaultListCellRenderer {

	/** Creates a new instance of ColorRenderer */
	public CustomListRenderer() {
		
	}

	public Component getListCellRendererComponent(JList list, 
			Object value,
			int index, 
			boolean isSelected,
			boolean cellHasFocus)
	{
		//Temporarily re-enable so it will paint with normal font, not greyed out
		list.setEnabled(true);
		
		//Paint!
		super.getListCellRendererComponent(list, 
				value, 
				index, 
				isSelected, 
				cellHasFocus);
		
		//Be sure to re-disable it!
		list.setEnabled(false);
		
		return this;
	}
}
